#include "DateTime.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* DateTime_classType = NULL;
VTable* DateTime_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* Bool equals(Obj? that) */
Bool DateTime_equals(Obj self, NullableObj that)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.equals not implemented yet"));
}


/* Int compare(Obj obj) */
Int DateTime_compare(Obj self, Obj obj)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.compare not implemented yet"));
}


/* Int hash() */
Int DateTime_hash(Obj self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.hash not implemented yet"));
}


/* Str toStr() */
Str* DateTime_toStr(Obj self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toStr not implemented yet"));
}


/* DateTime defVal */
DateTime* DateTime_defVal(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.defVal not implemented yet"));
}


/* DateTime now(Duration? tolerance) */
DateTime* DateTime_now_0(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.now not implemented yet"));
}


/* DateTime now(Duration? tolerance) */
DateTime* DateTime_now(Duration* tolerance)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.now not implemented yet"));
}


/* DateTime nowUtc(Duration? tolerance) */
DateTime* DateTime_nowUtc_0(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.nowUtc not implemented yet"));
}


/* DateTime nowUtc(Duration? tolerance) */
DateTime* DateTime_nowUtc(Duration* tolerance)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.nowUtc not implemented yet"));
}


/* Int nowTicks() */
Int DateTime_nowTicks(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.nowTicks not implemented yet"));
}


/* Int nowUnique() */
Int DateTime_nowUnique(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.nowUnique not implemented yet"));
}


/* DateTime makeTicks(Int ticks, TimeZone tz) */
DateTime* DateTime_makeTicks_1(Int ticks)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.makeTicks not implemented yet"));
}


/* DateTime makeTicks(Int ticks, TimeZone tz) */
DateTime* DateTime_makeTicks(Int ticks, TimeZone* tz)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.makeTicks not implemented yet"));
}


/* DateTime make(Int year, Month month, Int day, Int hour, Int min, Int sec, Int ns, TimeZone tz) */
DateTime* DateTime_make_5(Int year, Month* month, Int day, Int hour, Int min)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.make not implemented yet"));
}


/* DateTime make(Int year, Month month, Int day, Int hour, Int min, Int sec, Int ns, TimeZone tz) */
DateTime* DateTime_make_6(Int year, Month* month, Int day, Int hour, Int min, Int sec)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.make not implemented yet"));
}


/* DateTime make(Int year, Month month, Int day, Int hour, Int min, Int sec, Int ns, TimeZone tz) */
DateTime* DateTime_make_7(Int year, Month* month, Int day, Int hour, Int min, Int sec, Int ns)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.make not implemented yet"));
}


/* DateTime make(Int year, Month month, Int day, Int hour, Int min, Int sec, Int ns, TimeZone tz) */
DateTime* DateTime_make(Int year, Month* month, Int day, Int hour, Int min, Int sec, Int ns, TimeZone* tz)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.make not implemented yet"));
}


/* DateTime? fromStr(Str s, Bool checked) */
DateTime* DateTime_fromStr_1(Str* s)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromStr not implemented yet"));
}


/* DateTime? fromStr(Str s, Bool checked) */
DateTime* DateTime_fromStr(Str* s, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromStr not implemented yet"));
}


/* DateTime boot() */
DateTime* DateTime_boot(void)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.boot not implemented yet"));
}


/* Int ticks() */
Int DateTime_ticks(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.ticks not implemented yet"));
}


/* Date date() */
Date* DateTime_date(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.date not implemented yet"));
}


/* Time time() */
Time* DateTime_time(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.time not implemented yet"));
}


/* Int year() */
Int DateTime_year(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.year not implemented yet"));
}


/* Month month() */
Month* DateTime_month(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.month not implemented yet"));
}


/* Int day() */
Int DateTime_day(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.day not implemented yet"));
}


/* Int hour() */
Int DateTime_hour(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.hour not implemented yet"));
}


/* Int min() */
Int DateTime_min(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.min not implemented yet"));
}


/* Int sec() */
Int DateTime_sec(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.sec not implemented yet"));
}


/* Int nanoSec() */
Int DateTime_nanoSec(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.nanoSec not implemented yet"));
}


/* Weekday weekday() */
Weekday* DateTime_weekday(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.weekday not implemented yet"));
}


/* TimeZone tz() */
TimeZone* DateTime_tz(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.tz not implemented yet"));
}


/* Bool dst() */
Bool DateTime_dst(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.dst not implemented yet"));
}


/* Str tzAbbr() */
Str* DateTime_tzAbbr(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.tzAbbr not implemented yet"));
}


/* Int dayOfYear() */
Int DateTime_dayOfYear(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.dayOfYear not implemented yet"));
}


/* Str toLocale(Str? pattern) */
Str* DateTime_toLocale_0(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toLocale not implemented yet"));
}


/* Str toLocale(Str? pattern) */
Str* DateTime_toLocale(DateTime* self, Str* pattern)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toLocale not implemented yet"));
}


/* DateTime? fromLocale(Str str, Str pattern, TimeZone tz, Bool checked) */
DateTime* DateTime_fromLocale_2(Str* str, Str* pattern)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromLocale not implemented yet"));
}


/* DateTime? fromLocale(Str str, Str pattern, TimeZone tz, Bool checked) */
DateTime* DateTime_fromLocale_3(Str* str, Str* pattern, TimeZone* tz)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromLocale not implemented yet"));
}


/* DateTime? fromLocale(Str str, Str pattern, TimeZone tz, Bool checked) */
DateTime* DateTime_fromLocale(Str* str, Str* pattern, TimeZone* tz, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromLocale not implemented yet"));
}


/* DateTime toTimeZone(TimeZone tz) */
DateTime* DateTime_toTimeZone(DateTime* self, TimeZone* tz)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toTimeZone not implemented yet"));
}


/* DateTime toUtc() */
DateTime* DateTime_toUtc(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toUtc not implemented yet"));
}


/* DateTime toRel() */
DateTime* DateTime_toRel(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toRel not implemented yet"));
}


/* Duration minusDateTime(DateTime time) */
Duration* DateTime_minusDateTime(DateTime* self, DateTime* time)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.minusDateTime not implemented yet"));
}


/* DateTime plus(Duration duration) */
DateTime* DateTime_plus(DateTime* self, Duration* duration)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.plus not implemented yet"));
}


/* DateTime minus(Duration duration) */
DateTime* DateTime_minus(DateTime* self, Duration* duration)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.minus not implemented yet"));
}


/* DateTime floor(Duration accuracy) */
DateTime* DateTime_floor(DateTime* self, Duration* accuracy)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.floor not implemented yet"));
}


/* DateTime midnight() */
DateTime* DateTime_midnight(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.midnight not implemented yet"));
}


/* Bool isMidnight() */
Bool DateTime_isMidnight(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.isMidnight not implemented yet"));
}


/* Bool isLeapYear(Int year) */
Bool DateTime_isLeapYear(Int year)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.isLeapYear not implemented yet"));
}


/* Int weekdayInMonth(Int year, Month mon, Weekday weekday, Int pos) */
Int DateTime_weekdayInMonth(Int year, Month* mon, Weekday* weekday, Int pos)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.weekdayInMonth not implemented yet"));
}


/* DateTime? fromJava(Int millis, TimeZone tz) */
DateTime* DateTime_fromJava_1(Int millis)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromJava not implemented yet"));
}


/* DateTime? fromJava(Int millis, TimeZone tz) */
DateTime* DateTime_fromJava(Int millis, TimeZone* tz)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromJava not implemented yet"));
}


/* Int toJava() */
Int DateTime_toJava(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toJava not implemented yet"));
}


/* DateTime? fromIso(Str s, Bool checked) */
DateTime* DateTime_fromIso_1(Str* s)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromIso not implemented yet"));
}


/* DateTime? fromIso(Str s, Bool checked) */
DateTime* DateTime_fromIso(Str* s, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromIso not implemented yet"));
}


/* Str toIso() */
Str* DateTime_toIso(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toIso not implemented yet"));
}


/* DateTime? fromHttpStr(Str s, Bool checked) */
DateTime* DateTime_fromHttpStr_1(Str* s)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromHttpStr not implemented yet"));
}


/* DateTime? fromHttpStr(Str s, Bool checked) */
DateTime* DateTime_fromHttpStr(Str* s, Bool checked)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.fromHttpStr not implemented yet"));
}


/* Str toHttpStr() */
Str* DateTime_toHttpStr(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toHttpStr not implemented yet"));
}


/* Str toCode() */
Str* DateTime_toCode(DateTime* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::DateTime.toCode not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* DateTime_initType(void)
{
  if (DateTime_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = DateTime_initVTable();
    Type* type = Type_new("DateTime", baseType, vtable, sizeof(DateTime), sizeof(DateTimeVTable));
    Type_registerMethodImplementation(type, "boot", DateTime_boot, 0);
    Type_registerMethodImplementation(type, "compare", DateTime_compare, 1);
    Type_registerMethodImplementation(type, "date", DateTime_date, 0);
    Type_registerMethodImplementation(type, "day", DateTime_day, 0);
    Type_registerMethodImplementation(type, "dayOfYear", DateTime_dayOfYear, 0);
    Type_registerMethodImplementation(type, "dst", DateTime_dst, 0);
    Type_registerMethodImplementation(type, "equals", DateTime_equals, 1);
    Type_registerMethodImplementation(type, "floor", DateTime_floor, 1);
    Type_registerMethodImplementation(type, "fromHttpStr", DateTime_fromHttpStr_1, 1);
    Type_registerMethodImplementation(type, "fromHttpStr", DateTime_fromHttpStr, 2);
    Type_registerMethodImplementation(type, "fromIso", DateTime_fromIso_1, 1);
    Type_registerMethodImplementation(type, "fromIso", DateTime_fromIso, 2);
    Type_registerMethodImplementation(type, "fromJava", DateTime_fromJava_1, 1);
    Type_registerMethodImplementation(type, "fromJava", DateTime_fromJava, 2);
    Type_registerMethodImplementation(type, "fromLocale", DateTime_fromLocale_2, 2);
    Type_registerMethodImplementation(type, "fromLocale", DateTime_fromLocale_3, 3);
    Type_registerMethodImplementation(type, "fromLocale", DateTime_fromLocale, 4);
    Type_registerMethodImplementation(type, "fromStr", DateTime_fromStr_1, 1);
    Type_registerMethodImplementation(type, "fromStr", DateTime_fromStr, 2);
    Type_registerMethodImplementation(type, "hash", DateTime_hash, 0);
    Type_registerMethodImplementation(type, "hour", DateTime_hour, 0);
    Type_registerMethodImplementation(type, "isLeapYear", DateTime_isLeapYear, 1);
    Type_registerMethodImplementation(type, "isMidnight", DateTime_isMidnight, 0);
    Type_registerMethodImplementation(type, "make", DateTime_make_5, 5);
    Type_registerMethodImplementation(type, "make", DateTime_make_6, 6);
    Type_registerMethodImplementation(type, "make", DateTime_make_7, 7);
    Type_registerMethodImplementation(type, "make", DateTime_make, 8);
    Type_registerMethodImplementation(type, "makeTicks", DateTime_makeTicks_1, 1);
    Type_registerMethodImplementation(type, "makeTicks", DateTime_makeTicks, 2);
    Type_registerMethodImplementation(type, "midnight", DateTime_midnight, 0);
    Type_registerMethodImplementation(type, "min", DateTime_min, 0);
    Type_registerMethodImplementation(type, "minus", DateTime_minus, 1);
    Type_registerMethodImplementation(type, "minusDateTime", DateTime_minusDateTime, 1);
    Type_registerMethodImplementation(type, "month", DateTime_month, 0);
    Type_registerMethodImplementation(type, "nanoSec", DateTime_nanoSec, 0);
    Type_registerMethodImplementation(type, "now", DateTime_now_0, 0);
    Type_registerMethodImplementation(type, "now", DateTime_now, 1);
    Type_registerMethodImplementation(type, "nowTicks", DateTime_nowTicks, 0);
    Type_registerMethodImplementation(type, "nowUnique", DateTime_nowUnique, 0);
    Type_registerMethodImplementation(type, "nowUtc", DateTime_nowUtc_0, 0);
    Type_registerMethodImplementation(type, "nowUtc", DateTime_nowUtc, 1);
    Type_registerMethodImplementation(type, "plus", DateTime_plus, 1);
    Type_registerMethodImplementation(type, "sec", DateTime_sec, 0);
    Type_registerMethodImplementation(type, "ticks", DateTime_ticks, 0);
    Type_registerMethodImplementation(type, "time", DateTime_time, 0);
    Type_registerMethodImplementation(type, "toCode", DateTime_toCode, 0);
    Type_registerMethodImplementation(type, "toHttpStr", DateTime_toHttpStr, 0);
    Type_registerMethodImplementation(type, "toIso", DateTime_toIso, 0);
    Type_registerMethodImplementation(type, "toJava", DateTime_toJava, 0);
    Type_registerMethodImplementation(type, "toLocale", DateTime_toLocale_0, 0);
    Type_registerMethodImplementation(type, "toLocale", DateTime_toLocale, 1);
    Type_registerMethodImplementation(type, "toRel", DateTime_toRel, 0);
    Type_registerMethodImplementation(type, "toStr", DateTime_toStr, 0);
    Type_registerMethodImplementation(type, "toTimeZone", DateTime_toTimeZone, 1);
    Type_registerMethodImplementation(type, "toUtc", DateTime_toUtc, 0);
    Type_registerMethodImplementation(type, "tz", DateTime_tz, 0);
    Type_registerMethodImplementation(type, "tzAbbr", DateTime_tzAbbr, 0);
    Type_registerMethodImplementation(type, "weekday", DateTime_weekday, 0);
    Type_registerMethodImplementation(type, "weekdayInMonth", DateTime_weekdayInMonth, 4);
    Type_registerMethodImplementation(type, "year", DateTime_year, 0);
    Type_registerFieldImplementation(type, "defVal", DateTime_defVal, NULL);
    DateTime_classType = type;
    DateTime_initStatic();
  }
  return DateTime_classType;
}


VTable* DateTime_initVTable(void)
{
  if (DateTime_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(DateTimeVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    ((FanObjVTable*)vtable)->compare = DateTime_compare;
    ((FanObjVTable*)vtable)->equals = DateTime_equals;
    ((FanObjVTable*)vtable)->hash = DateTime_hash;
    ((FanObjVTable*)vtable)->toStr = DateTime_toStr;
    DateTime_classVTable = vtable;
  }
  return DateTime_classVTable;
}


void DateTime_initStatic(void)
{
}
